Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

Backport of #4236 and #4250 then cut 0.2 🎉

If we complete a `ChannelMonitorUpdate` persistence but there are
blocked `ChannelMonitorUpdate`s in the channel, we'll skip all the
post-monitor-update logic entirely. While its correct that we can't
resume the channel (as it expected the monitor updates it generated
to complete, even if they ended up blocked), the post-update
actions are a `channelmanager.rs` concept - they cannot be tied to
blocked updates because `channelmanager.rs` doesn't even see
blocked updates.

This can lead to a channel getting stuck waiting on itself. In a
production environment, an LDK user saw a case where:
 (a) an MPP payment was received over several channels, let's call
     them A + B.
 (b) channel B got into `AwaitingRAA` due to unrelated operations,
 (c) the MPP payment was claimed, with async monitor updating,
 (d) the `revoke_and_ack` we were waiting on was delivered, but the
     resulting `ChannelMonitorUpdate` was blocked due to the
     pending claim having inserted an RAA-blocking action,
 (e) the preimage `ChannelMonitorUpdate` generated for channel B
     completed persistence, which did nothing due to the blocked
     `ChannelMonitorUpdate`.
 (f) the `Event::PaymentClaimed` event was handled but it, too,
     failed to unblock the channel.

Instead, here, we simply process post-update actions when an update
completes, even if there are pending blocked updates. We do not
fully unblock the channel, of course.

Backport of 8f4a4d2

Conflicts due to upstream macro rewrite resolved in:
 * lightning/src/ln/channelmanager.rs
This aligns `handle_monitor_update_completion` closer with upstream
after backporting 8f4a4d2, making
potential future backports somewhat simpler.
Various fields in `ChannelDetails` refer to channel information
which changes on splice, which we ensure is consistently documented
here.

Backport of c3cc331
@TheBlueMatt TheBlueMatt added this to the 0.2 milestone Dec 2, 2025
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Dec 2, 2025

👋 Thanks for assigning @wpaulino as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@TheBlueMatt
Copy link
Collaborator Author

Included the 0.1.8 changelog from #4255 since we should list the bug fixes there

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 94.95798% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.88%. Comparing base (a16bec0) to head (e276b44).
⚠️ Report is 7 commits behind head on 0.2.

Files with missing lines Patch % Lines
lightning/src/ln/functional_test_utils.rs 84.61% 1 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              0.2    #4254      +/-   ##
==========================================
+ Coverage   88.86%   88.88%   +0.02%     
==========================================
  Files         180      180              
  Lines      138042   138117      +75     
  Branches   138042   138117      +75     
==========================================
+ Hits       122667   122772     +105     
+ Misses      12557    12528      -29     
+ Partials     2818     2817       -1     
Flag Coverage Δ
fuzzing 20.85% <0.00%> (-0.59%) ⬇️
tests 88.73% <94.95%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheBlueMatt
Copy link
Collaborator Author

Oops, had to update the commit sha in the 0.1.8 changelog commit message after rebasing #4255, this should be good to go now.

@TheBlueMatt TheBlueMatt requested a review from wpaulino December 2, 2025 18:55
@TheBlueMatt TheBlueMatt merged commit 311ad94 into lightningdevkit:0.2 Dec 2, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants